<style>
    .content {
        min-height: 800px;
    }
</style>

<body class="inside-header inside-aside is-dialog">
<div id="main" role="main">
    <div class="tab-content tab-addtabs">
        <div id="content">
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <section class="content-header hide">
                        <h1>
                            控制台 <small>Control panel</small>
                        </h1>
                    </section>
                    <div class="content">
                        <form id="edit-form" class="form-horizontal form-ajax" role="form" method="POST" action="">
                            <div class="form-group">
                                <label for="c-sort" class="control-label col-xs-12 col-sm-2">排序:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-sort" class="form-control" name="row[sort]" type="number" value="<?=$row['sort']?>" placeholder="可为空">
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="parent_id" class="control-label col-xs-12 col-sm-2">上级栏目:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <select class="form-control" required="true" name="row[parent_id]">
                                        <option value="0" selected="selected">请选择</option>
                                        <?php foreach($cate as $v):?>
                                        <option value="<?=$v['id']?>" <?php if($v['id'] == $row['parent_id']):?>selected<?php endif;?>>
                                        <?=$v['title']?>
                                        </option>
                                        <?php foreach($v['children'] as $c):?>
                                        <?php if(!empty($c['title'])):?>
                                        <option value="<?=$c['id']?>" <?php if($c['id'] == $row['parent_id']):?>selected<?php endif;?>>
                                        &nbsp;&nbsp;|--
                                        <?=$c['title']?>
                                        </option>
                                        <?php endif;?>
                                        <?php endforeach;?>
                                        <?php endforeach;?>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="action" class="control-label col-xs-12 col-sm-2">标题:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="title" name="row[title]" value="<?=$row['title']?>" data-rule="required" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="c-sub_title" class="control-label col-xs-12 col-sm-2">副标题:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="sub_title" name="row[sub_title]" value="<?=$row['sub_title']?>" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="alias" class="control-label col-xs-12 col-sm-2">URL名称:<br>英文或数字，用于伪静态展示</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="alias" name="row[alias]" value="<?=$row['alias']?>" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="point" class="control-label col-xs-12 col-sm-2">锚点:<br>用于锚点定位</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="point" name="row[point]" value="<?=$row['point']?>" />
                                </div>
                            </div>
                            <div class=" form-group">
                                <label for="link_url" class="control-label col-xs-12 col-sm-2">原始路由地址:<br>不新建控制器请勿修改</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="alias" name="row[link_url]" value="<?=$row['link_url']?:'cate/index'?>" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="c-image" class="control-label col-xs-12 col-sm-2">封面图:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="form-inline">
                                        <input id="c-image" class="form-control" size="50" name="row[img_cover]" type="text" value="<?=$row['img_cover']?>">
                                        <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/*,mp4" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> 上传</button></span>
                                        <ul class="row list-inline plupload-preview" id="p-image"></ul>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="c-description" class="control-label col-xs-12 col-sm-2">摘要:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <textarea name="row[description]" class="form-control" cols="30" rows="5"><?=$row['description']?></textarea>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="c-tpl_list" class="control-label col-xs-12 col-sm-2">列表页模板:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="tpl_list" name="row[tpl_list]" value="<?=$row['tpl_list']?>" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="c-tpl_show" class="control-label col-xs-12 col-sm-2">详情页模板:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="tpl_show" name="row[tpl_show]" value="<?=$row['tpl_show']?>" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="c-tpl_page" class="control-label col-xs-12 col-sm-2">单页面模板:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="tpl_page" name="row[tpl_page]" value="<?=$row['tpl_page']?>" />
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="c-page_content" class="control-label col-xs-12 col-sm-2">正文内容:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div id="c-page_content" class="my-content" name="row[page_content]" data-uploadurl="" data-mimetype="image/*">
                                        <?=$row['page_content']?>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="c-is_nav" class="control-label col-xs-12 col-sm-2">导航:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <label for="row[is_nav]-normal">
                                        <input id="row[is_nav]-normal" name="row[is_nav]" type="radio" value="1" <?php if(isset($row['is_nav']) && $row['is_nav'] == 1):?>checked<?php endif;?>> 是
                                    </label>
                                    <label for="row[is_nav]-hidden">
                                        <input id="row[is_nav]-hidden" name="row[is_nav]" type="radio" value="0" <?php if(!isset($row['is_nav']) || $row['is_nav'] == 0):?>checked<?php endif;?>> 否
                                    </label>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="c-is_index" class="control-label col-xs-12 col-sm-2">首页:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <label for="row[is_index]-normal">
                                        <input id="row[is_index]-normal" name="row[is_index]" type="radio" value="1" <?php if($row['is_index'] == 1):?>checked<?php endif;?>> 是
                                    </label>
                                    <label for="row[is_index]-hidden">
                                        <input id="row[is_index]-hidden" name="row[is_index]" type="radio" value="0" <?php if($row['is_index'] == 0):?>checked<?php endif;?>> 否
                                    </label>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="c-status" class="control-label col-xs-12 col-sm-2">状态:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <label for="row[status]-normal">
                                        <input id="row[status]-normal" name="row[status]" type="radio" value="1" <?php if(!isset($row['status']) || $row['status'] == 1):?>checked<?php endif;?>> 正常
                                    </label>
                                    <label for="row[status]-hidden">
                                        <input id="row[status]-hidden" name="row[status]" type="radio" value="0" <?php if(isset($row['status']) && $row['status'] == 0):?>checked<?php endif;?>> 禁用
                                    </label>
                                </div>
                            </div>
                            <div class="form-group hidden layer-footer">
                                <div class="col-xs-2"></div>
                                <div class="col-xs-12 col-sm-8">
                                    <button type="submit" class="btn btn-success btn-embossed disabled">确定</button>
                                    <button type="reset" class="btn btn-default btn-embossed">重置</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>